package WSService

import (
	"encoding/json"
)

type WSEnterConferReq struct {
	Uid int64 `json:"uid"`
}
type WSRecvReq struct {
	Cmd      int    `json:"cmd"`
	ConferId int64  `json:"roomId,omitempty"`
	FileName string `json:"filename,omitempty"`
	Data     string `json:"data,omitempty"`
}
type WSResponse struct {
	Cmd  int    `json:"cmd"`
	Ret  int    `json:"ret"`
	Data string `json:"data"`
}
type WSUpdateUserNameReq struct {
	Uid  int64  `json:"uid"`
	Name string `json:"name"`
}
type WSUpdateDeviceStateReq struct {
	Uid   int64 `json:"uid"`
	Id    int64 `json:"id"`
	State int   `json:"state"`
}
type NotifyDeviceState struct {
	State int `json:"state"`
}
type NotifyUserName struct {
	Uid  int64  `json:"uid"`
	Name string `json:"name"`
}
type NotifyUserConferState struct {
	ConferId int64 `json:"conferId"`
	State    int   `json:"state"`
}
type WSCommonReq struct {
	Uid  int64  `json:"uid"`
	Data string `json:"data,omitempty"`
}

type WhiteboardRes struct {
	Uid int64  `json:"uid"`
	Url string `json:"url"`
}

func PacketResMsg(cmd, ret int, data []byte) []byte {
	ErrMsg := &WSResponse{
		Cmd:  cmd,
		Ret:  ret,
		Data: string(data),
	}
	msg, _ := json.Marshal(ErrMsg)
	return msg
}
